package com.ushine.design.design.b_structural_type.e_facade.b_example;

import java.io.FileOutputStream;

/**
 * 文件保存类，充当子系统类
 *
 * @author yls
 */
public class FileWriter {
    public void write(String fileNameDes, String encryStr) {
        System.out.println("保存密文，写入文件");
        try {
            FileOutputStream outputStream = new FileOutputStream(fileNameDes);
            outputStream.write(encryStr.getBytes());
            outputStream.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("发生异常。");
        }
    }
}
